import axios from './api' // 倒入 api
import config from './config.js' // 倒入默认配置
export const BASEURL = config.baseURL

/* 将所有接口统一起来便于维护
 * 如果项目很大可以将 url 独立成文件，接口分成不同的模块
 */

export const IMAGEPATH = BASEURL + 'appserver'

// 预约-所有预约列表
export const GETORDERSEARCH = (params) => {
  return axios({
    url: 'order/search',
    method: 'GET',
    params,
  })
}

// 预约列表-导出excel
export const ORDEREXPORT = BASEURL + 'order/export'

// 预约-根据客户获取报名线索
export const GETORDECLUEINFO = (params) => {
  return axios({
    url: 'order/getclue',
    method: 'GET',
    params,
  })
}

// 预约-新增预约
export const SUBMITORDERINFO = (params) => {
  return axios({
    url: 'order/submit',
    method: 'POST',
    data:params,
  })
}


// 预约-取消预约
export const CANCELORDERINFO = (params) => {
  return axios({
    url: 'order/cancel',
    method: 'POST',
    data:params,
  })
}

// 预约-写回访
export const ADDRETURNVISIT = (params) => {
  return axios({
    url: 'returnvisit/add',
    method: 'POST',
    data:params,
  })
}

// 预约-已到店-成交
export const ORDERARRIVED = (params) => {
  return axios({
    url: 'order/arrived',
    method: 'POST',
    data:params,
  })
}

// 获取预约详情
export const GETORDERINFO = params => {
  return axios({
    url: 'order/info',
    method: 'GET',
    params,
  })
}

// 预约-修改预约
export const UPDATEORDERRESCHEDULE = (params) => {
  return axios({
    url: 'order/reschedule',
    method: 'POST',
    data:params,
  })
}

// 获取成交项目
export const GETDEALS = params => {
  return axios({
    url: 'order/getdeals',
    method: 'GET',
    params,
  })
}

// 待提醒-提醒
export const ORDER_REMIND = params => {
  return axios({
    url: 'order/remind',
    method: 'POST',
    data:params,
  })
}

// 预约-医院反馈-获取反馈列表
export const GET_OFEEDBACK_SEARCH = params => {
  return axios({
    url: 'ofeedback/order/search',
    method: 'GET',
    params,
  })
}

// 预约-反馈记录-获取列表
export const GET_OFEEDBACK_RECORD = params => {
  return axios({
    url: 'ofeedback/search',
    method: 'GET',
    params,
  })
}

// 预约-反馈记录-获取列表-导出excel
export const GET_OFEEDBACK_EXPORT = BASEURL + 'ofeedback/export'
